import BaseAnimationCanvas from "../standard/entities/Canvas/BaseAnimationCanvas";
import AnimationRectPainting from "../custom/Painting/AnimationRectPainting";
import Rect from "../standard/entities/Shape/Rect";
import Point2D from "../standard/entities/Point/Point2D";
import GravityCircularPainting from "../custom/Painting/GravityCircularPainting";
import AnimationFrameRequest from "../standard/utils/AnimationFrameRequest";
import BubblePainting from "../custom/Painting/BubblePainting";
import LifeCycleCanvas from "../standard/entities/Canvas/LifeCycleCanvas";
import eUtil from '../standard/utils/every-utils'

export default function (id) {
    // let canvas = new BaseCanvas({id: 'canvas-content', zIndex: 3});
    let canvas1 = new BaseAnimationCanvas({id, zIndex: 2});
    let rect = new AnimationRectPainting(new Rect(new Point2D(100, 100), 10, 300));
    let rect1 = new AnimationRectPainting(new Rect(new Point2D(550, 550), 200, 15), '#fff');
    canvas1.addPainting(rect);
    canvas1.addPainting(rect1);
    canvas1.startDrawing();

    let canvasBubble = new LifeCycleCanvas({id, zIndex: 4});

    for (let i = 0; i < 10; i++) {
        let a = Math.random() * 15 + i / 2.5 + 5;
        canvasBubble.addPainting(new GravityCircularPainting({
            startPoint: new Point2D(a + (canvasBubble.width - 2 * a) / i, Math.random() * canvasBubble.height - canvasBubble.height / 2),
            mass: a * 10,
            color: eUtil.getRandomColor(),
            r: a
        }));
    }

    canvasBubble.startDrawing();

};